// import { createStore } from 'vuex'
import { createStore, createLogger } from 'vuex'

// 引入自动同步插件
import createPersistedstate from 'vuex-persistedstate'

import user from './modules/user'
import cart from './modules/cart'
import category from './modules/category'

export default createStore({
  state: {
  },

  mutations: {
  },
  actions: {
  },
  modules: {
    user,
    cart,
    category
  },
  plugins: [
    createPersistedstate({
      key: 'erabbit-client-pc-store', // 奖励存入本地的key名
      paths: ['user', 'cart'] // 那个模块需要执行自动同步
    }),
    createLogger()
  ]

})
